package com.yylending.las.common.widgets;

import android.content.Context;
import android.support.v7.widget.GridLayoutManager;


/**
* 控制RecycleView相应滑动事件的LinearLayoutManager
* @author lenovo
* @date 2017/4/13 13:52
*/
public class CustomGridLayoutManager extends GridLayoutManager {
    private boolean isScrollEnabled = true;

    public CustomGridLayoutManager(Context context, int spanCount) {
        super(context,spanCount);
    }

    public void setScrollEnabled(boolean flag) {
        this.isScrollEnabled = flag;
    }

    @Override
    public boolean canScrollVertically() {
        return isScrollEnabled && super.canScrollVertically();
    }
}
